$base-color: #CCC;
$base-gradient: 'bevel';

$tabs-bottom-gradient: 'bevel';
$tabs-bar-gradient: 'bevel';
$tabs-bottom-active-gradient: 'bevel';

$toolbar-gradient: 'matte';

$list-header-color: #FFF !default;
$list-header-bg-color: darken(#AAA, 10%) !default;
$list-header-gradient: 'matte';

@import 'sencha-touch/default/all';
@include sencha-panel;
@include sencha-buttons;
@include sencha-toolbar-forms;
@include sencha-tabs;
@include sencha-toolbar;
@include sencha-indexbar;
@include sencha-list;
@include sencha-layout;
@include sencha-form;

.playerbar {
    //@include linear-gradient(color-stops(lighten($base_color, 30%), lighten($base_color, 15%) 4%, $base_color));
    background-image: subtunes_image('playbar-bg.png');
	background-repeat: repeat-x;
    .x-toolbar, .x-form .x-panel-body,  .x-form .x-panel-body {
        padding: 0;
    }
    
    .x-toolbar {
        padding: 0 0.8em 0 10em;   
    }
    
    .x-form .x-panel-body, .x-field-slider {
        background-color: transparent;   
    }
}
.bottom-bar {
    background-image: subtunes_image('bottombar-bg.png');
	background-repeat: repeat-x;	
	&.x-toolbar-light .x-button{
		background-repeat: repeat-x;
		background-image: subtunes_image('bottom-bar-tab.png');
		&.x-button-pressed {
			background-image: subtunes_image('bottom-bar-tab-depressed.png');
			text-shadow: rgba(255, 255, 255, 0.246094) 0px 0px 0px;
			color: white;
		}
	}
}


.volumeslider {
    margin: 0;
    padding: 0 10em 0 0.8em;
    border: 0px none white;
    top: 0.5em;

    .x-input-slider, .x-thumb::before, .x-thumb, .x-input-slider::after {
        height: 1.4em;   
    }
    .x-input-slider {
        margin: 0;
    }
    .x-input-slider::after {
        top: 0;
        margin: 0;
        @include border-radius(0.7em, 0.7em);
    }
    .x-thumb::before, .x-thumb {
        top:0;
        width: 1.4em;
    }
    .x-thumb::before {
        left: 0;
    }
}

.x-thumb::before, .x-thumb.x-dragging::before {
    border: solid 1px rgba(79, 79, 79, 0.75);
    @include linear-gradient(color-stops(#b3b4b8, #444446 50%, #45464b 50%, #3f3f47), left top);
}

.trackpositionslider {
    .x-slider, .x-input-slider::after, .x-thumb::before {
        height: 0.6em;
    }
    .x-slider {
        margin: 0;
    }
    .x-input-slider::after {
        margin: 0;
        top: 0em;
    }
    .x-thumb::before {
        left: 0;
    }
    .x-thumb::before {
        width: 0.6em;
        top: 0;
    }
}

.controlbuttons {
    top: 0.3em;   
    
    .x-panel-body {
        left: 33.3% !important;
        clear: both;
        float: left;
        width: 100%;
    }
    
    .button {
        right: 50%;
        float: left;
		height: 32px;
		width: 32px;
        margin: 0.4em 0.2em 0;
		background-repeat: no-repeat;
        &.playstatebutton {
            height: 41px;
            width: 41px;
            margin-top: 0em;
            padding: 0.5em 0.5em 0.5em 0.6em;
			background-image: subtunes-image('play-button.png');
            &.play {
				background-image: subtunes-image('pause-button.png');
            }
        }
		&.backbutton {
			background-image: subtunes-image('back-button.png');
		}
		&.forwardbutton {
			background-image: subtunes-image('forward-button.png');
		}
    }
}

.leftmenu {
    width: 14em;
    border-right: 1px solid #121a2e;
    background-color: #f2f4f6;
    
    .x-list {
        background-color: #f2f4f6;
        
        .x-list-item {
            border: 0px none white; 
			padding: 0.7em 0.8em;
            &.selected {
				background-image: subtunes-image('leftbar-selected-bg.png');
				background-repeat: repeat-x;
				color: #FFF;
				.entry.music {
					background-image: subtunes-image('music-icon-selected.png');
				}
				.entry.playlist {
					background-image: subtunes-image('playlist-icon-selected.png');
				}
			}
            .entry {
                font-weight: bold;
				padding-left: 28px;
				background-repeat: no-repeat;
				background-position: 0px -11px;
				&.music {
					background-image: subtunes-image('music-icon.png');
				}
				&.playlist {
					background-image: subtunes-image('playlist-icon.png');
				}
            }
        }   
    }
}

.now-playing {
	border-top: 1px solid $list-header-bg-color;
	padding-left: 40px;
	background-color: #F2F4F6;
	width: 100%;
	h2 {
		font-weight: bold;
		font-size: 114%;
		color: #666;
		margin: 5px 0;
	}
	img {
		@include box-shadow;
	}
	.song-meta {
		.meta {
			font-size: 70%;
			color: #999;
			&.track {
				font-weight: bold;
			}
		}
	}
}

h1 {
    text-align: center;
	background-image: subtunes-image('x-list-header.png');
	background-repeat: repeat-x;
    border-top: 1px solid $list-header-bg-color;
    border-bottom: 1px solid darken($list-header-bg-color, 20%);
    font-weight: bold;
    font-size: 0.8em;
    color: $list-header-color;
    padding: 0.2em 1.02em;
    @include bevel-by-background($list-header-bg-color);
    @if $include-list-highlights {
        -webkit-box-shadow: 0px .1em .3em rgba(0, 0, 0, 0.3);
    }
	text-shadow: rgba(0, 0, 0, 0.246094) 0px 0.08em 0px;
}

.x-list-header {
	background-image: subtunes-image('x-list-header.png');
	background-repeat: repeat-x;
	text-shadow: rgba(0, 0, 0, 0.246094) 0px 0.08em 0px;
}
.x-indexbar-item {
	line-height: 2em;
	color: #6a737d;
}

.grid {
    .x-list {
        .x-list-item {
            padding: 0em 0.8em;
        }
    }
    .row {
		.indexes, .musicDirectory {
			padding-top: 12px;
			margin-left: 2em;
		}
        strong: {
            font-weight: bold;
        }
        .dir {
            padding: 0.5em  0.3em;
        }
        img {
            float: left;
            margin-left: -0.8em;
            padding-right: 0.4em;
        }
        .cell {
            width: 24%;
            height: 2.6em;
            border-right: 1px solid #ccc;
            float: left;
            padding: 0.5em  0.1em 0.5em 0.3em;
            &.title {
                padding-right: 0em;
            }
            &.duration {
                border-right: 0px none #FFF;
            }
        }
    }
}

#sm2-container {
    position: relative;
    width: 1px;
    height: 1px;
    _overflow: hidden; 

    object, embed {
        position:absolute;
    }
    &.swf_timedout,&.swf_timedout object,&.swf_timedout embed {
        left:auto;
        top:auto;
        width:48px;
        height:48px;
    }
	&.swf_unblocked {
		width:1px;
		height:1px;
		object, embed {
			left:-9999em;
			top:-9999em;
		}
	}
	&.swf_error {
		display:none;
	}
	&.high_performance {
		position:absolute;
		position:fixed;
		_top:-9999px; 
		_left:-9999px;
		bottom:0px;
		left:0px;
		width:48px;
		height:48px;
		z-index:99; 
		&.swf_unblocked {
			z-index:auto;
			object, embed {
				width:8px;
				height:8px;
				left:auto;
				top:auto;
			}
		}
		&.swf_timedout {
			z-index:99; 
		}
	}
}
